package com.watson.juc.single;

/**
 * @author watson
 * @date 2021/8/2 11:47
 * @Description: 饿汉式，可能浪费内存
 **/
public class Hungry {
    //成员变量 可能会浪费空间
    private byte[] data1 = new byte[1021 * 1024];
    private byte[] data2 = new byte[1021 * 1024];
    private byte[] data3 = new byte[1021 * 1024];
    private byte[] data4 = new byte[1021 * 1024];

    private Hungry() {
    }

    public static final Hungry HUNGRY = new Hungry();

    public static Hungry getInstance() {
        return HUNGRY;
    }
}
